package exception;

public class FinallyDemo {
    public static void main(String[] args) {
        System.out.println("开始");
        try {
            String s = "null";
            System.out.println(s.length());
            return;
        } catch (NullPointerException e) {
            System.out.println("出错");
        } finally {
            System.out.println("finally代码");
        }
        System.out.println("结束");
    }
}
